package com.spark.laboratory.controller;

import com.spark.laboratory.pojo.IntroduceStep;
import com.spark.laboratory.service.CommentsService;
import com.spark.laboratory.service.IntroduceStepService;
import com.spark.laboratory.service.UsersService;
import com.spark.laboratory.utils.FengliJsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 数据接口
 * @author lixizheng
 */
@Controller
public class DataController {

    private final IntroduceStepService introduceStepService;

    @Autowired
    public DataController(IntroduceStepService introduceStepService, CommentsService commentsService, UsersService usersService) {
        this.introduceStepService = introduceStepService;
    }

    @ResponseBody
    @RequestMapping("/introduce-step/getAllData")
    public FengliJsonResult getData(){
        List<IntroduceStep> introduceStepList = introduceStepService.queryAllData();
        return FengliJsonResult.ok(introduceStepList);
    }
}
